<?php
class finance_ctl_bill_fee_item extends desktop_controller{
	var $name = "费用项";
    public function index()
    {
        $actions_base['title'] = app::get('finance')->_('费用项');
        $actions_base['actions'] = $custom_actions;
        $actions_base['allow_detail_popup'] = true;
        $actions_base['use_buildin_set_tag'] = false;
        $actions_base['use_buildin_export'] = false;
        $actions_base['use_buildin_filter'] = false;

        $actions_base['use_view_tab'] = false;

        $this->finder('finance_mdl_bill_fee_item',$actions_base);
    }
    function edit(){
        $axbill = '';
        if(isset($_GET['id'])){
            $id = $_GET['id'];
            $axbill_obj = kernel::single('finance_mdl_bill_fee_item');
            $axbill = $axbill_obj->getList('*', array('fee_item_id'=>$id), 0, 1);
        }
        $this->pagedata['pam_account'] = $axbill[0];
        $this->page('bill/fee/additem.html');

    }
    function doEdit(){
         // 添加
        $this->begin();
        $feeItem_model = $this->app->model('bill_fee_item');
        $id=$_POST['pam_account']['fee_item_id'];
        $arr_order['pam_account']['AXfee_item_code'] = $_POST['pam_account']['AXfee_item_code'];
        $db = kernel::database();
        $db->beginTransaction();
        if( $feeItem_model->update($arr_order['pam_account'], array('fee_item_id' => $id)) )
        {
            $db->commit();
        }else{
            $msg = '保存失败，请联系客服!';
            return false;
        }
        $this->end(true, app::get('ome')->_('修改成功！'));
    }


    
}